Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a UI-only hack to experiment with syncing on every app start/resume.
In general, our assumption was that people will open the app only sporadically,
and we want to push data more frequently than that. So we do so in a background
process.
However, due to the various restrictions on background operations in android,
sometimes the background process is not launched. We can ask the user to "force
sync" but that is not a viable solution as well.
We push a UI-only update that force-syncs on every app launch to see the extent
of this problem and confirm that this fixes it.
Once we know that this works, we should move this to native code, potentially
by pushing data at the end of a trip as we do on iOS. We may also want to
introduce silent push notifications on android as well.
Testing done:
Saw message "app has started/resumed, forcing sync on android" in the console
in both cases.